.root {
  box-sizing: border-box;
  display: block;
  border: none;
  color: var(--color);
  background-color: var(--background);
  padding: 0;
  font-size: var(--fontSize);
  font-weight: var(--fontWeight);
  font-family: var(--fontFamily);
  text-transform: var(--textTransform);
  line-height: var(--lineHeight);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  appearance: none;
  transition: background-color 0.2s;
  outline: none;
  overflow: visible;
  border-bottom-left-radius: var(--borderRadius);
  border-bottom-right-radius: var(--borderRadius);

  /*
  Something about Planner's CSS build is making Firefox not recognize
  @supports (position: sticky), hence the duplicate position rules below
  (relative is for IE11)
  */

  /* stylelint-disable declaration-block-no-duplicate-properties */
  position: relative;
  position: sticky;
  /* stylelint-enable declaration-block-no-duplicate-properties */

  &::before {
    content: "";
    box-sizing: border-box;
    width: calc(100% + 0.5rem);
    height: calc(100% + 0.5rem);
    border: var(--focusRingWidth) solid var(--focusRingColor);
    position: absolute;
    top: -0.25rem;
    left: -0.25rem;
    border-bottom-left-radius: var(--borderRadius);
    border-bottom-right-radius: var(--borderRadius);
    transform: scale(0.25);
    opacity: 0;
    transition: all 0.2s ease-out;
  }

  &:focus {
    &::before {
      opacity: 1;
      transform: scale(1);
    }
  }

  &:focus,
  &:hover {
    background-color: var(--backgroundHover);

    .icon {
      transform: translate3d(0, -0.0625rem, 0) scale(1.2);
    }
  }

  &[aria-disabled] {
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.5;
  }
}

.icon {
  display: block;
  font-size: 0.75rem;
  margin-left: var(--iconMargin);
  transform: translate3d(0, -0.0625rem, 0);
  transition: all 0.2s;
}

.direction--up,
.direction--down {
  .layout {
    padding-right: var(--hasIconRightPadding);
  }
}

.layout {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: var(--padding);
}
